//
//  ViewController.m
//  量角器
//
//  Created by zhaoyf on 2021/7/20.
//

#import "ViewController.h"
#import "ProtractorView.h"
@interface ViewController ()
@property (nonatomic,strong)ProtractorView *pp;
@property (nonatomic,strong)UILabel *titleLab;
@property (nonatomic,strong)UIImageView *bgImageView;
//我再测试一下子
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.bgImageView];
    [self.view addSubview:self.pp];
    [self.view addSubview:self.titleLab];
    //我是测试分支
}



-(ProtractorView *)pp
{
    if (_pp == nil) {
        _pp = [[ProtractorView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        _pp.backgroundColor = [UIColor clearColor];
        __weak __typeof__(self) weakSelf = self;
        _pp.angleBlock = ^(CGFloat angle) {
            weakSelf.titleLab.text = [NSString stringWithFormat:@"%f",angle];
        };
    }
    return _pp;
}

-(UILabel *)titleLab
{
    if (_titleLab == nil) {
        _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(100, self.view.frame.size.height-100, 100, 30)];
    }
    return _titleLab;
}

-(UIImageView *)bgImageView
{
    if (_bgImageView == nil) {
        _bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        _bgImageView.image = [UIImage imageNamed:@"WechatIMG74.jpeg"];
    }
    return _bgImageView;
}
//我是主线程内容
@end
